''' 测试，练习 '''

# class Students():
#     '''这是学生类'''
#     pass
#
#
# print(Students.__dict__)
# print(Students.__doc__)
# print(Students.__class__)

class Human():
    def __init__(self,name,age,money):
        self.name = name
        self.age = age
        self.money = money

    def teach(self,other,skill):
        self.money += 100
        other.money -=100
        print("{}收取学费{}元，教{}学习{}".format(self.name,100, other.name,skill))

    def work(self,hour):
        self.money += hour*100
        print('{}工作{}小时赚了{}钱，总存款{}'.format(self.name,hour,hour*100,self.money))
    def get_info(self):
        print("姓名：{} 年龄：{} 存款：{}".format(self.name,self.age,self.money))

    def borrow(self,other,money):
        if self.money >=money:
            self.money -=money
            other.money +=money
            print("{}向{}借{}钱".format(other.name,self.name,money))

h1 = Human('露丝',26,500)
h2 =Human('珍妮',22,300)

h1.get_info()
h2.get_info()

h1.teach(h2,'演戏')
h2.teach(h1,'python')

h1.work(5)

h1.get_info()
h2.get_info()

h1.borrow(h2,200)


h1.get_info()
h2.get_info()


''' isinstance(obj,class)/(obj,(,))判断某个对象是否是某个类 '''

class Dog():
    pass

d1 = Dog()
print(isinstance(d1,Dog))
print(isinstance(d1,Human))
print(isinstance(d1,(Dog,Human)))
print(d1.__class__)